import 'package:equatable/equatable.dart';

abstract class GooglePlayApiNotificationData {}

class GooglePlayApiOneTimePurchaseItemNotificationData extends Equatable
    implements GooglePlayApiNotificationData {
  const GooglePlayApiOneTimePurchaseItemNotificationData({
    required this.purchaseToken,
    required this.purchaseItemSku,
    required this.type,
  });

  final String purchaseToken;
  final String purchaseItemSku;
  final GooglePlayApiOneTimePurchaseItemNotificationType type;

  @override
  List<Object?> get props {
    return [
      purchaseToken,
      purchaseItemSku,
      type,
    ];
  }
}

class GooglePlayApiSubscriptionNotificationData extends Equatable
    implements GooglePlayApiNotificationData {
  const GooglePlayApiSubscriptionNotificationData({
    required this.purchaseToken,
    required this.purchaseItemSku,
    required this.type,
  });

  final String purchaseToken;
  final String purchaseItemSku;
  final GooglePlayApiSubscriptionNotificationType type;

  @override
  List<Object?> get props {
    return [
      purchaseToken,
      purchaseItemSku,
      type,
    ];
  }
}

class GooglePlayApiTestNotificationData extends Equatable implements GooglePlayApiNotificationData {
  const GooglePlayApiTestNotificationData();

  @override
  List<Object?> get props => [];
}

enum GooglePlayApiOneTimePurchaseItemNotificationType {
  purchased,
  canceled,
}

enum GooglePlayApiSubscriptionNotificationType {
  recovered,
  renewed,
  canceled,
  purchased,
  onHold,
  inGracePeriod,
  restarted,
  priceChangeConfirmed,
  deferred,
  paused,
  pauseScheduleChanged,
  revoked,
  expired,
}
